package it.rap.applications.pages.widgets;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.custom.CLabel;

public class FilterTreeDetailWidget extends Composite {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8251423003335219991L;
	private final Composite contentComp;
	private Group detailFilterGroup;
	
	private Label nameFilterLabel;
	private Label nameFilterLabelValue;
	
	private Label descFilterLabel;
	private CLabel descFilterLabelValue;
	
	public FilterTreeDetailWidget(Composite parent) {
		super(parent, SWT.NONE);
		setLayout( new GridLayout(1, false) );
	
		contentComp = createTreeDetailComposite();
	}

	private Composite createTreeDetailComposite() {
		Composite contentComp = new Composite(this, SWT.NONE);		
		contentComp.setLayout(new GridLayout(2, false));
		
		detailFilterGroup = new Group(contentComp, SWT.NONE);
		GridData gd_detailFilterGroup = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_detailFilterGroup.heightHint = 164;
		gd_detailFilterGroup.widthHint = 304;
		detailFilterGroup.setLayoutData(gd_detailFilterGroup);
		detailFilterGroup.setBounds(0, 0, 250, 75);
		detailFilterGroup.setText("Filter");
		detailFilterGroup.setLayout(new GridLayout(2, false));
		
		nameFilterLabel = new Label(detailFilterGroup, SWT.NONE);
		nameFilterLabel.setText("Name");
		
		nameFilterLabelValue = new Label(detailFilterGroup, SWT.BORDER);
		GridData gd_nameFilterLabelValue = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_nameFilterLabelValue.widthHint = 167;
		nameFilterLabelValue.setLayoutData(gd_nameFilterLabelValue);
		nameFilterLabelValue.setText( "*" );
		
		descFilterLabel = new Label(detailFilterGroup, SWT.NONE);
		descFilterLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
		descFilterLabel.setText("Descrizione");
		
		descFilterLabelValue = new CLabel(detailFilterGroup, SWT.BORDER);
		GridData gd_descFilterLabelValue = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_descFilterLabelValue.heightHint = 109;
		gd_descFilterLabelValue.widthHint = 208;
		descFilterLabelValue.setLayoutData(gd_descFilterLabelValue);
		descFilterLabelValue.setText("*");
		new Label(contentComp, SWT.NONE);
		
		return contentComp;
	}	
	
	public Label getNameFilterLabelValue() {
		return nameFilterLabelValue;
	}

	public CLabel getDescFilterLabelValue() {
		return descFilterLabelValue;
	}

	public Composite getContentComp() {
		return contentComp;
	}
}
